<%@page import="net.Board.db.NoticeBean"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<%
	String level = (String)session.getAttribute("level");
	if(!level.equals("0")){
		%>
			<script type="text/javascript">
				alert("잘못된 정보입니다.");
				history.back();
			</script>
		<%
	}
	List noticeList = (List)request.getAttribute("noticeList");

	int totel = (Integer)(request.getAttribute("totel"));
	int st_totel=(Integer)(request.getAttribute("st_totel"));
	int te_totel=(Integer)(request.getAttribute("te_totel"));
%>

<body>
<h1>관리자 페이지</h1>
<h3>전체 회원수</h3>
<h5>전체: <%if(totel==0){%>0<%}else{%><%=totel%><%}%></h5>
<h5>교직원 : <%if(totel==0){%>0<%}else{%><%=te_totel%><%}%></h5>
<h5>학생: <%if(totel==0){%>0<%}else{%><%=st_totel%><%}%></h5>

<h3>공지사항</h3>
<h5><a href="./NoticleWriting.bo">글쓰기</a></h5>
<table>
<tr><td>번호</td><td>제목</td><td>작성자</td><td>날짜</td><td>조회수</td></tr>
<%
	if(noticeList!=null){
		for(int i =0; i<noticeList.size(); i++){
			NoticeBean noticebean = (NoticeBean)noticeList.get(i);	
		%>
		<tr><td><%=noticebean.getNot_num() %></td><td><%=noticebean.getNot_title() %></td><td><%=noticebean.getNot_subject() %></td><td><%= noticebean.getNot_data() %></td><td><%= noticebean.getNot_recont()%></td></tr>
		<%
		}
	}else
	{
		%>
		<tr><td colspan="5">내용이 없습니다.</td></tr>
		<%
	}
%>
</table>
<h3>회원등록</h3>
<h4>교수</h4>
<h4>학생</h4>

<h3>문의사항</h3>
</body>
</html>